package com.example.tangjiangxu.sqlciphertest;

import android.content.Context;

import net.sqlcipher.database.SQLiteDatabase;
import net.sqlcipher.database.SQLiteOpenHelper;

/**
 * Created by tangjiangxu on 4/10/17.
 * 自定义的SQLiteOpenHelper,继承Sqlcipher包中的SQLiteOpenHelper类，而不是原生的
 */

public class MySQLiteOpenHelper extends SQLiteOpenHelper{
    public static final String CREATE_TABLE = "create table Book(name text, pages integer)";

    public MySQLiteOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_TABLE);
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
